package so.wy.servicecenter.businessbed.web.pay;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
import so.wy.servicecenter.base.exception.ServiceException;
import so.wy.servicecenter.base.exception.WebException;
import so.wy.servicecenter.base.frame.web.AbstractWeb;
import so.wy.servicecenter.base.frame.web.webhand.WebExceptionHandler;
import so.wy.servicecenter.businessbed.service.pay.PayResultService;

@Service
@Scope("prototype")
public class PayResultWeb extends AbstractWeb {
    @Autowired
    private PayResultService payResultService;



    //支付结果回调
    @WebExceptionHandler
    public void handPayResult(String xmlData) throws WebException {
        try {
            payResultService.handPayResult(xmlData);
        } catch (ServiceException e) {
            throw exception(e);
        }
    }

    //退款结果回调
    @WebExceptionHandler
    public void handRefundResult(String xmlData) throws WebException {
        try {
            payResultService.handRefundResult(xmlData);
        } catch (ServiceException e) {
            throw exception(e);
        }
    }

}
